function updatepwd(){
	var oldpassword = $("#oldpassword").val();
	var newpassword = $("#newpassword").val();
	var confirmpassword = $("#confirmpassword").val();
	if(oldpassword==""||newpassword==""||confirmpassword==""){
		document.getElementById("updatepwd_tip").hidden = false;
		document.getElementById("updatepwd_tip").innerText = "输入数据有误，系统无法为您启动对应的服务";
	}else{
		if(newpassword!=confirmpassword){
			document.getElementById("updatepwd_tip").hidden = false;
			document.getElementById("updatepwd_tip").innerText = "两次密码不匹配";
		}else{
			$.ajax({
				type:"post",
				url:"updatepwd",
				async:true,
				data:{newpassword:newpassword,oldpassword:oldpassword},
				dataType:"json",
				success:function(data){
					if(data==2){
						document.getElementById("updatepwd_tip").hidden = false;
						document.getElementById("updatepwd_tip").innerText = "旧密码输入错误";
					}else if(data==1){
						document.getElementById("updatepwd_tip").hidden = false;
						document.getElementById("updatepwd_tip").innerText = "修改成功，新密码为："+newpassword;
					}
				},
				error:function(){
					document.getElementById("updatepwd_tip").hidden = false;
					document.getElementById("updatepwd_tip").innerText = "系统故障";
				}
			});
		}
	}
}
